package edu.study.common.retry;

import edu.study.api.common.enums.BaseStrEnum;
import lombok.Getter;

@Getter
public enum RetryPolicyEnum implements BaseStrEnum {
    
    SAME_INTERVAL("SAME_INTERVAL", "等间隔"),
    POW("POW", "指数级");

    private String code;
    private String message;

    private RetryPolicyEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static RetryPolicyEnum parseCode(String code) {
        for (RetryPolicyEnum result : values()) {
            if (result.getCode().equals(code)) {
                return result;
            }
        }
        return null;
    }
}
